SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE dbo.[DnnProduct_CDS_TemplateDefaultStampConfigList]
	@TemplateID int
AS
BEGIN
	SELECT * FROM (
		SELECT S.[ID], [Name], [Description], 'Stamp' AS [DRMType] FROM [DISC_DefaultStampConfig] S
		INNER JOIN [DnnProduct_CDS_StampSets] SS ON SS.[DefaultStampConfigID] = S.[ID] AND SS.[TemplateID] = @TemplateID
		UNION ALL
		SELECT S.[ID], [Name], [Description], [DRMType] FROM [DISC_DefaultDRMStampConfig] S
		INNER JOIN [DnnProduct_CDS_StampSets] SS ON SS.[DefaultDRMStampConfigID] = S.[ID] AND SS.[TemplateID] = @TemplateID
	) AS [DefaultStampConfig]
	ORDER BY [Name] ASC
END
GO
